<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>{$webtitle}</title>
<link href="../css/main.css" type="text/css" rel="stylesheet"/>
<script type="text/javascript" src="../js/jquery.js"></script>
<script type="text/javascript" src="../js/admin.js"></script>
<script language="javascript" type="text/javascript" src="../js/datecontrols/WdatePicker.js"></script>
</head>

<body >
<form action="" method="post" id="form" onsubmit="return checkItem()">

	<table class="tb_main">
		<thead>
			<tr class="tb_title"><th colspan="2"><{ $lang.group_mail }></th></tr>
		</thead>
		<tbody>
		<tr>
			<td width="15%" class="tdTitle"><{ $lang.email_title }></td>
			<td align="left"><input type="text" size="30" name="emailtitle" id="emailtitle"/></td>
		</tr>
		<tr>
			<td class="tdTitle"><{ $lang.select_profession }></td>
			<td align="left">
				<input name="profession[]" type="checkbox" value="1" />
				<label for="1"><{ $lang.warrior }></label>
				<input name="profession[]" type="checkbox" value="2" />
				<label for="2"><{ $lang.wizard }></label>
				<input name="profession[]" type="checkbox" value="3" />
				<label for="3"><{ $lang.archer }></label>
				<input name="profession[]" type="checkbox" value="4" />
				<label for="4"><{ $lang.summoner }></label>
				<input name="profession[]" type="checkbox" value="5" />
				<label for="5"><{ $lang.magician }></label>
				<input id="checkall" type="checkbox" onClick="Check_All()" />
				<label for="0" style="color:red"><{ $lang.check_all }>/<{ $lang.not_check_all }></label></td>
		</tr>
		<tr>
			<td class="tdTitle"><{ $lang.level_range }></td>
			<td align="left">
				<input name="min_level" type="text" id="min_level" size="5"/>
				-
				<input name="max_level" type="text" id="max_level" size="5"/></td>
		</tr>
		<tr>
			<td class="tdTitle"><{ $lang.timing_send_time }></td>
			<td align="left">
				<input name="timing" type="text" id="timing" size="30" class="Wdatetime" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"/>
				<span style="color:red">(<{ $lang.timing_send_time_remind }>)</span></td>
		</tr>
		
		<tr>
			<td class="tdTitle"><{ $lang.email_content }></td>
			<td align="left"><textarea name="content" cols="70" rows="5" id="content"></textarea></td>
		</tr>
		
				<{ foreach from=$giftArray item=item key=key}>
		<tr>
		<{if $key == 0}>
			<td class="tdTitle" rowspan="7"><{ $lang.item_setting }><br/><font color="red">(<{ $lang.item_setting_remind }>)</font></td>
		<{/if}>
			<td align="left">
	    			<{ $lang.item }><{$item}>：
	    			<select class="selectoption" tabindex="<{$key+5}>" id="itemtype_<{$key}>" name="itemtype[]" onchange="showDaoju(<{$key}>);">
				  		<{html_options options=$arrRes selected=$giftdata.data.$key.itemtype}>
	  			 	</select>	
	  				<{ $lang.quantity }>：
	  				<input tabindex="<{$key+15}>" type="text" onblur="checkItem();" id="itemnum_<{$key}>" name="itemnum[]" style="width:55px;" maxlength="7" value="<{$giftdata.data.$key.itemnum}>" />
	  			 		<span id="daoju_<{$key}>"<{if $giftdata.data.$key.itemtype != 1}> class="sClose"<{/if}>>
	  			 	<{ $lang.daoju }>ID：
	  			 	<input type="text" onblur="getItemName(<{$key}>);" id="itemid_<{$key}>" name="itemid[]" class="sText" value="<{$giftdata.data.$key.itemid}>" />
	  				<{ $lang.or }> <{ $lang.item_name }>：
	  				<input type="text" id="itemname_<{$key}>" name="itemname[]" value="<{$giftdata.data.$key.itemname}>" onchange="getItemId(<{$key}>);" class="sText" /></span><span style="color:#F00" id="daoju_error_<{$key}>"></span>
	  				<input type="radio" name="isBind[<{$key}>]" id="isBind" value="1" checked="checked"/><label><{ $lang.bind }></label>
	  				<input type="radio" name="isBind[<{$key}>]" id="isBind" value="0"/><label><{ $lang.not_bind }></label>
	  			<input type="text" id="sendtitle" name="sendtitle" style="width:180px;display: none;" value="333" />
	  		</td>
		</tr>
	  			<{ /foreach }>
	  			
		<tr>
			<td colspan="2" align="center">
				<input type="submit" value="<{ $lang.send }>" name="send" id="send"/>
				<input type="reset" value="<{ $lang.reset }>" name="reset"/>
			</td>
		</tr>
		</tbody>
	</table>
	
</form>

<script charset="utf-8" src="../js/kindeditor/kindeditor-min.js"></script>
<script charset="utf-8" src="../js/kindeditor/lang/zh_CN.js"></script> 
<script language="javascript">
	var editor;
	KindEditor.ready(function(K) {
	        editor = K.create(
	                						'textarea[name="content"]',
	                						{	filterMode : true,
	                    						height : '350px',
	                    						width:'700px',
	                    						items:[ 'undo', 'redo',  'forecolor','bold',
		                    						        'link', 'unlink']
	                        				}
	        				); 
	});
</script>
<script type="text/javascript">
function Check_All(){
	a=document.getElementsByName('profession[]');
	l=a.length;
	if (document.getElementById('checkall').checked==true) flag=1;
	else flag=0;
		for(var i=0;i<l;i++){
			if (flag==1){
				a[i].checked = true;
			}else{
				a[i].checked = false;
			}
		}
}

function checkDaoju()
{
	return chk_mail_title_length(document.getElementById('title').value);
	for(i=0;i<10;i++)
	{
		if($('#itemtype_' + i).val() == 1)
		{
			break;
		}
		user_flag = true;
	}
	
	if (!user_flag )
	{
		alert('<{ $lang.item_not_exist }>');
		return false;
	}else{
		return true;
	}
}
</script>

</body>
</html>